<?php
/**
 * Object Relational Persistence Mapping Class for table: service_insurance_map
 *
 * @package	com.athena
 * @author	LHV
 */
class ServiceInsuranceMap extends ORDataObject {

	/**#@+
	 * Fields of table: service_insurance_map mapped to class members
	 */
	var $service_insurance_map_id		= '';
	var $insurance_support_id		= '';
	var $item_id		= '';
	var $enum_item_type		= '';
	/**#@-*/


	/**
	 * DB Table
	 */
	var $_table = 'service_insurance_map';

	/**
	 * Primary Key
	 */
	var $_key = 'service_insurance_map_id';
	
	/**
	 * Internal Name
	 */
	var $_internalName = 'ServiceInsuranceMap';

	/**
	 * Handle instantiation
	 */
	function ServiceInsuranceMap() {
		parent::ORDataObject();
	}
	
    public function isInsurranceSupported($serviceId, $serviceType) {
    	$ds = new Datasource_sql();
        $sql = array (
            'cols'      => "*",
            'from'      => "$this->_table",
            'where'     => "item_id ='$serviceId' AND enum_item_type = '$serviceType'"
        );
        
        $ds->setup($this->_db, $sql);
        $result = $ds->toArray();
        if (empty($result)) return false;
        return true;
        
    }

	
}
?>
